<!DOCTYPE HTML>
<html>
<head></head>
<body>
<form method="post">
	<table class="dv-table" style="width: 100%;background: #FAFAFA; padding: 5px;margin-top: 5px;">
		<tr>
			<td>Firstname</td>
			<td><input class="easyui-validatebox" name="firstname" required="true"/></td>
			<td>Lastname</td>
			<td><input class="easyui-validatebox" name="firstname" required="true"/></td>
		</tr>
		<tr>
			<td>phone</td>
			<input name="phone" />
			<td>email</td>
			<td><input name="email" class="easyui-validatebox" validType="email" /></td>
		</tr>
	</table>
	<div style="padding: 5px 0; text-align: right;padding-right: 30px;">
		<a href="#" class="easyui-linkbutton" iconCls="icon-save" plain="true" onclick="saveItem(&lt;?php echo $_REQUEST['index'];&gt)">save</a>
		<a href="#" class="easyui-linkbutton" iconCls="icon-cancel" plain="true" onclick="cancelItem(&lt;?php; echo $_REQUEST['index']&gt )">cancel</a>
	</div>
</form>
</body>
<script type="text/javascript">
function saveItem(index){
	var row=$("#dg").datagrid("getRows")[index];
	var url=row.isNewRecord? "save_user.php" : "update_user.php?id"=row.id;
	$("#dg").datagrid("getRowDetail",index).find("form").form("submit",{
		url:url,
		onSubmit:function(){
			return $(this).form("validate");
		},
		success:function(data){
			
		}
	});
}
function cancelItem(index){
	
}
</script>
</html>